package com.ubing.boot.notesforjava.domel.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName : UserTest
 * @Description : UserTest
 * @Author : Xxxxx
 * @Date: 2023-05-16 19:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserTest {
    private String userName;
    private String userId;
    private String phoneNumber;

    public static void main(String[] args) {

        Date date = new Date(1691720321000L);

        // 创建SimpleDateFormat对象，定义日期时间的格式
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        // 使用SimpleDateFormat对象的format()方法将Date对象格式化为字符串
        String dateTimeString = sdf.format(date);
        System.out.println(dateTimeString);
    }
}
